package com.itshen.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.itshen.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author stephen
 */
public interface UserMapper extends BaseMapper<User> {

    /**
     * 注解方式
     * @param wrapper
     * @return
     */
    @Select("select * from user ${ew.customSqlSegment}")
    List<User> selectAll(@Param(Constants.WRAPPER) Wrapper<User> wrapper);

    /**
     * xml配置方式
     * <select id="selectAll" resultType="com.itshen.entity.User">
     *     select * from user ${ew.customSqlSegment}
     * </select>
     *
     * List<User> selectAll(@Param(Constants.WRAPPER) Wrapper<User> wrapper);
     */
}